
#include "Graphics/Configuration.hpp"
#include "Scene/Manager.hpp"

using namespace	Scene;

Manager::Manager() :
	AManager(),
	_scenes(),
	_graphics()
{
	this->_initialize();
}


bool		Manager::run()
{
	this->_graphics.create();

	while (this->_graphics.isOpened() && this->isValid())
	{
		this->_graphics.clear();
		this->_graphics.display();
	}

	if (this->_graphics.isOpened())
	{
		this->_graphics.close();
		this->_isValid = false;
	}

	return this->isValid();
}


Manager::~Manager() throw()
{
}


bool		Manager::_initialize()
{
	Graphics::Configuration	config(800, 600, 32, "MicroMachines", true);

	config.setVSync(false);
	config.setFrameRate(60);

	this->_graphics.setConfiguration(config);

	return (_isValid = true);
}
